﻿namespace SharpSoft.Geometries
{
    public struct Point3D
    {
        public Point3D(double x, double y, double z)
        {
            this.X = x;
            this.Y = y;
            this.Z = z;
        }
        public double X { get; set; }
        public double Y { get; set; }
        public double Z { get; set; }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        public override bool Equals(object obj)
        {
            if (obj is Point2D p2)
            {
                return this.Z == 0D && p2.X == this.X && p2.Y == this.Y;
            }
            else if (obj is Point3D p3)
            {
                return p3.Z == this.Z && p3.X == this.X && p3.Y == this.Y;
            }
            return false;
        }
    }
}
